package cn.clq.cxfspringboot.service.impl;

import cn.clq.cxfspringboot.pojo.User;
import cn.clq.cxfspringboot.service.UserService;

import javax.jws.WebService;
import java.util.HashMap;
import java.util.Map;

@WebService(targetNamespace = "http://service.demo.cn/",endpointInterface = "cn.clq.cxfspringboot.service.UserService")
public class UserServiceImpl implements UserService{

    private Map<String, User> userMap = new HashMap<String, User>();

    public UserServiceImpl() {
        System.out.println("向实体类插入数据");
        User user = new User();
        user.setUsername("zhansan");
        user.setPassword("zhansan");
        userMap.put("1", user);

        User user1 = new User();
        user1.setUsername("lisz");
        user1.setPassword("lisz");
        userMap.put("2", user1);
    }

    @Override
    public String getName(String userId) {
        return "liyd-" + userId;
    }
    @Override
    public User getUser(String userId) {
        System.out.println("userMap是:"+userMap);
        return userMap.get(userId);
    }
}
